<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>服务详情</title>
    <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script type="text/javascript" src="http://apps.bdimg.com/libs/bootstrap/3.3.4/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="http://apps.bdimg.com/libs/bootstrap/3.3.4/css/bootstrap.min.css"></link>
    <script>
        $(function () {
            var quantity = $("#quantity").val();
            $("#add").click(function () {
                quantity++;
                $("#quantity").val(quantity);
            })
            $("#sub").click(function () {
                if(quantity != 1) {
                    quantity--;
                    $("#quantity").val(quantity);
                }
            })
            $("#buyNow").click(function () {
                var quantity = $("#quantity").val();
                var productId = $("#productId").val();
                window.location.href = "buyNow?productId="+productId+"&quantity="+quantity;
            })
        })
    </script>
</head>
<body>
<div align="center">
    <table>
        <tr>
            <td rowspan="8"><img src="${productVo.imageUrl}"></td>
            <input type="hidden" id="productId" value="${productVo.productId }">
        </tr>
        <tr>
            <td>${productVo.productName}</td>
        </tr>
        <tr>
            <td>价格：￥${productVo.price}/${productVo.unit}</td>
        </tr>
        <tr>
            <td>分类：${productVo.categoryName}</td>
        </tr>
        <tr>
            <td>商家：${productVo.busTeamName}</td>
        </tr>
        <tr>
            <td>销量：${productVo.amount}    累计评价：${amount}</td>
        </tr>
        <tr>
            <td><button id="add">+</button><input name="quantity" value="1" id="quantity"><button id="sub">-</button></td>
        </tr>
        <tr>
            <td><button id="buyNow">立即购买</button>
        </tr>
    </table>
</div>
<div align="center">
    <label>服务介绍</label>
    ${productVo.content}
</div><br>
<div>
    <label>评价</label>

    [#list commentList as comment]
        <div class="panel panel-danger">
            <div class="panel-heading">
                <span class="panel-title">${comment.createTime?string("yyyy-MM-dd")}</span>
            </div>
            <div class="panel-body">
            ${comment.comment}
            </div>
        </div>
    [/#list]
</div>


</body>
</html>